The HTML input type "number" allows the user to enter a numeric value within a specified range.
meaning the user must enter a value before submitting the form.
Suppose we have a form where the user needs to enter a number between 1 and 1000:
<form>
<label for="quantity">Enter a number:</label><br>
<input type="number" id="quantity" name="quantity" min="1" max="1000" step="1" required><br><br>
<input type="submit" value="Submit">
</form>
咨询微信客服
0516-6662 4183
立即获取方案或咨询top